# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pyptlib
pkgname=('python2-pyptlib' 'python-pyptlib')
_pkgname=pyptlib
pkgver=0.0.6
pkgrel=10
pkgdesc='A python implementation of the Pluggable Transports for Circumvention specification for Tor.'
arch=('any')
url='https://pypi.org/project/pyptlib/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('f54ee3ae51f2d6884b0157f8cec3e9af267f926e50728478b961551d069fc6c4a2840d59e74d5b0f93b4bb305d9f91f31b91fa4425d1931688ffc5783f6192f9')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pyptlib() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-pyptlib() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

